#include <iostream>
using namespace std;


class Date
{
public:
	Date(int year = 1900, int month = 1, int day = 1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
//	private:
	int _year;
	int _month;
	int _day;
};

// operator运算符 做函数名
bool operator==(const Date& x, const Date& y)
{
	return x._year == y._year
		&& x._month == y._month
		&& x._day == y._day;
}

bool operator<(const Date& x, const Date& y)
{
	if (x._year < x._year)
	{
		return true;
	}
	else if (x._year == x._year)
	{
		if (x._month < y._month)
		{
			return true;
		}
		else if (x._month == y._month)
		{
			return x._day < y._day;
		}
	}

	return false;
}

int main()
{
	Date d1(2024, 1, 28);
	Date d2(2024, 2, 27);
	cout << operator==(d1, d2) << endl;
	cout << operator<(d1, d2) << endl;

	cout << (d1 == d2) << endl; // cout << (operator==(d1, d2)) << endl;
	cout << (d1 < d2) << endl;
	return 0;
}
